import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
const app = createApp(App)

// ---------------- 权限控制 ----------------
import './permission'

// ---------------- UI 组件库 ----------------
import ElementPlus from 'element-plus'
import locale from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'                   // element-plus样式
import 'element-plus/theme-chalk/dark/css-vars.css'    // element-plus css变量文件

// ---------------- 样式相关 ----------------
import '@/assets/styles/iconfont.css'                   // 字体文件
import 'animate.css'                                    // 动画库
import '@/assets/styles/base.scss'                      // 初始化样式
import '@/assets/styles/element-plus/controller.scss'   // Element Plus 自定义覆盖

// ---------------- 插件 ----------------
import 'amfe-flexible'                                  // 搭配 postcss-pxtorem 做移动端适配

// ---------------- 自定义指令 ----------------
import { setupDirectives } from '@/directives'
setupDirectives(app)

// ---------------- Vue 应用挂载 ----------------
app.use(createPinia())
app.use(router)
app.use(ElementPlus, { locale })
app.mount('#app')
